home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Plug-In Power Pack for Netscape Communicator
/
Plug-In Power Pack for Netscape Communicator.iso
/
plugins
/
dataviews
/
include
/
vostd.h
< prev
next >
Wrap
C/C++ Source or Header
|
1997-05-08
|
31KB
|
861 lines
/*
| file name -- VOstd.h
|===================================================================
|
| Copyright (c) 1987-90 V.I. Corporation
|
| VOstd.h - Declarations and defines for users of drawing system
|
| Written by Alan C. Morse 9 Feb 84
|
| Revision history:
| alan c morse 24 Jan 86 Move OT_* constants from VO.h
| alan c morse 23 Dec 86 Add Input object stuff
| alan c morse 14 Apr 87 Add DRAW_INFO
| alan c morse 27 May 87 Add ASSIGN_OBJECT
| russell turner & daniel dee
| 17 sep 87 New attribute fields
| russell turner 27 Oct 87 Default constants for attributes
| Attribute field name constants
| (VOuAttr)
| russell turner 22 Jan 88 TOP and BOTTOM flags for VOdqAdd
| russell turner 26 Feb 88 More flags
| alan c morse 27 apr 90 Add VOSK* flags
| john methot 18 dec 90 Add SD_DYN_ENABLED,
| SD_DYN_DISABLED, SD_DYN_NONE
| kathy madison 1 jan 91 Add flags for Visiblity and
| Text dynamics.
| chris hoffmann 23 jan 91 flags for images and icons
| charlie hileman 22 feb 91 changed dynamic flag names
| alan morse 16 sep 91 Add OT_REFCOLOR
| mike krasnik 16 sep 91 Add DRAW_ENV.
| lynn smith 12 Apr 94 Change DV_TRANSPARENT, DV_ABSOLUTE,
| DV_RELATIVE, and DV_SUCCESS to DV_*.
|
| * It may be advisable from now on to record changes as part
| of SCCS using the comment facility in SCCS.
|-------------------------------------------------------------------
|
| This header is for users of the VO routines. It contains
| the externally visible data types and parameter definitions
| for those routines. This is in contrast to the VO.h header
| which contains the definitions and data types that are
| only used within the VO routines.
|
| NOTE TO IMPLEMENTERS: Care must be taken to make sure that
| the typedefs include here are compatible with the corresponding
| internally visible forms in VO.h.
|
|===================================================================
*/
#ifndef VOSTD_H
#define VOSTD_H
/*-----------------------------------------------------------------
|
| OBJECT
| A fundamental entity in the drawing system is the OBJECT,
| which is implemented as an abstract data type that has its
| type internally specified. OBJECTs are defined in terms
| of other OBJECTs and primitive constants.
*/
#ifdef OBJECT
#undef OBJECT
#endif
typedef LONG OBJECT;
typedef UBYTE O_TYPE; /* Object type */
/*------------------------------------------------------------------
|
| DATUM
| More general than an OBJECT is a DATUM, which includes an
| OBJECT as a subtype. A DATUM type is externally specified,
| that is, how it is interpreted depends on its context.
| Therefore, unlike an OBJECT, interpreting a DATUM requires
| passing flags around that describe what it is. The values
| for the flags are defined below.
|
| A DATUM can be a: pointer to a DV_TEXT string, a float, an
| INTEGER, or an OBJECT. The DATUM TYPE flags indicate which
| of these classes it is. Furthermore, if the DATUM is an
| OBJECT, the DATUM TYPE flag indicates what type of OBJECT
| it is.
*/
typedef LONG DATUM;
typedef int DATUM_TYPE;
/* Flags for the different types in the DATUM */
/* And MACROS for testing this flags. */
#define FLOAT_DATUM ((DATUM_TYPE)('f'))
#define IS_FLOAT_DATUM(datype) ((datype)==FLOAT_DATUM)
#define INT_DATUM ((DATUM_TYPE)('i'))
#define IS_INT_DATUM(datype) ((datype)==INT_DATUM)
#define OBJECT_DATUM(obtype) ((DATUM_TYPE)('O')|(DATUM_TYPE)(obtype<<8))
#define IS_OBJECT_DATUM(datype) (((datype)&0xFF)==('O'))
#define DATUM_O_TYPE(datype) (((datype)>>8)&0xFF)
#define TEXT_DATUM ((DATUM_TYPE)('t'))
#define IS_TEXT_DATUM(datype) ((datype)==TEXT_DATUM)
/*===================================================================
|
| DATUM_DESC
| This is the unpacked form of the above data type.
| In general, use a DATUM type to pass the data around, when
| you don't care about its actual contents. Use the DATUM_DESC
| type or the macros described below, to look at the contents.
|
| Representing the type externally is done to improve space
| and time efficiency at the expense of ease of use.
*/
typedef union
{
DATUM DATUM_alias;
float f;
LONG i;
OBJECT O;
char *t;
} DATUM_DESC;
/*===================================================================
|
| ATTRIBUTES
| This is the structure describing the union of all the attributes
| of the graphical objects. This structure is used to as an
| argument block to the routines that manage the graphical objects
| and that manage the user-interface. Thus, the structure acts
| as a means of handling/communicating graphical attributes
| throughout the drawing editor system. Most objects will only
| look at a portion of the structure, ignoring the inappropriate
| entries. Note that there is be a special entry, EMPTY_FIELD,
| that indicates "no entry in this field." Entries that may be
| dynamic are declared as OBJECT. Static entries are declared to
| be the smallest size that can be used to hold them.
*/
#define EMPTY_FIELD -2
#define EMPTY_FLOAT_FIELD -99999.0
typedef struct ATTRIBUTES
{
OBJECT foreground_color; /* A NULL color means that this color
| is to be inherited. */
OBJECT background_color; /* A NULL color means that this color
| is to be inherited. */
char line_width; /* Width of LINE object, reasonable values are
| in the range [1(default),3] */
char line_type; /* Line type of LINE object */
# define SOLID_LINE ((char)1)
char fill_status; /* Is the object to be filled or has borders? */
# define EDGE ((char)('u')) /* originally FILLED_OBJECT */
# define DV_TRANSPARENT ((char)('t'))
# define FILL ((char)('f')) /* originally UNFILLED_OBJECT */
# define FILL_WITH_EDGE ((char)(0xFB))
# define EDGE_WITH_FILL ((char)(0xBF))
# define FILLED_OBJECT FILL
# define UNFILLED_OBJECT EDGE
char text_direction; /* Direction that text will be drawn: */
# define HORIZONTAL_TEXT ((char)('h'))
# define VERTICAL_TEXT ((char)('v'))
char text_position; /* Indicates the position of the text
| with respect to the anchor point. Possible values: */
# define AT_TOP_EDGE ((char)(0x1))
# define AT_BOTTOM_EDGE ((char)(0x2))
# define AT_LEFT_EDGE ((char)(0x4))
# define AT_RIGHT_EDGE ((char)(0x8))
# define CENTERED ((char)(0x10))
# define POSITION_FLAGS_MASK ((char)(0x1F)) /* OR of above flags */
char text_font; /* Text font to use. Default is 0 */
char text_size; /* Size of text to draw. Reasonable values are
| in the range [1,3] */
char arc_direction; /* Direction (clockwise of counter-clockwise) to
| use in drawing an arc between two intersecting lines. Possible
| values are: */
# define CLOCKWISE ((char)('r'))
# define COUNTER_CLOCKWISE ((char)('l'))
char curve_type; /* Used by the POLYGON object to determine the
| the type of the curve defined by the POLYGON. The curve is
| either a cubic b-spline with one of three end conditions or
| a set of straight lines (the default when this field is NULL).
| Possible values: */
# define FLOATING_ENDS ((char)('f'))
# define OPEN_ENDS ((char)('o'))
# define CLOSED_ENDS ((char)('c'))
/************************************************ vector text fields **********/
char *text_fontname; /* file name of text font */
float text_width; /* horizontal text expansion factor */
float text_height; /* vertical text expansion factor */
float text_angle; /* cc angle of text baseline from horizontal */
float text_slant; /* clockwise angle of text slant from vertical*/
float text_charspace; /* inter-character spacing fraction */
float text_linespace; /* inter-line spacing fraction */
int text_underline; /* underlining */
int text_weight; /* typographic weight */
# define NORMAL_WEIGHT 400
# define BOLDFACE_WEIGHT 700
int text_ptsize; /* size of font in typographic tenths of points */
/****************************** node and edge fields *****************/
char *name; /* Name of object */
RECTANGLE *node_bounds; /* Bounding box of node */
char edge_type; /* Type of edge */
# define DIRECTED_EDGE ((char)('d'))
# define UNDIRECTED_EDGE ((char)('u'))
/****************************** Proportional fill flags *****************/
char prop_fill; /* Use proportional fill? What type?*/
# define PROP_FILL_NONE ((char)0)
# define PROP_FILL_RIGHT ((char)1)
# define PROP_FILL_UP ((char)2)
# define PROP_FILL_LEFT ((char)3)
# define PROP_FILL_DOWN ((char)4)
short fill_amount; /* Proportion of area to fill [0...32k] */
} ATTRIBUTES;
/***************************************************************************
*
* Default attribute field values
*
***************************************************************************/
#define DEF_BACKGROUND_COLOR ((char)NULL)
#define DEF_FOREGROUND_COLOR ((char)NULL)
#define DEF_LINE_WIDTH ((char)1)
#define DEF_LINE_TYPE SOLID_LINE
#define DEF_FILL_STATUS UNFILLED_OBJECT
#define DEF_TEXT_DIRECTION HORIZONTAL_TEXT
#define DEF_TEXT_POSITION CENTERED
#define DEF_TEXT_FONT ((char)0)
#define DEF_TEXT_SIZE ((char)2)
#define DEF_ARC_DIRECTION COUNTER_CLOCKWISE
#define DEF_CURVE_TYPE (char)NULL
#define DEF_VFONT_SIZE 1024
#define DEF_TEXT_CHARSPACE (0.0F)
#define DEF_TEXT_LINESPACE (0.0F)
#define DEF_TEXT_WIDTH (1.0F)
#define DEF_TEXT_HEIGHT (1.0F)
#define DEF_TEXT_ANGLE (0.0F)
#define DEF_TEXT_SLANT (0.0F)
#define DEF_TEXT_FONTNAME "roman.vf"
#define DEF_TEXT_PTSIZE 120
#define DEF_SFTEXT_HEIGHT 0.0
#define DEF_SFTEXT_WIDTH 0.0
#define DEF_SFTEXT_FONTNAME "Times New Roman"
#define DEF_TEXT_UNDERLINE 0
#define DEF_TEXT_WEIGHT NORMAL_WEIGHT
#define DEF_NAME NULL
#define DEF_NODE_BOUNDS NULL
#define DEF_EDGE_TYPE UNDIRECTED_EDGE
#define DEF_PROP_FILL PROP_FILL_NONE
#define DEF_FILL_AMOUNT SHORT_MAX
/***************************************************************************
*
* Attribute field enumerated constants
* for use by VOuAttr routine
*
***************************************************************************/
#define FOREGROUND_COLOR 1
#define BACKGROUND_COLOR 2
#define LINE_WIDTH 3
#define LINE_TYPE 4
#define FILL_STATUS 5
#define TEXT_DIRECTION 6
#define TEXT_POSITION 7
#define TEXT_FONT 8
#define TEXT_SIZE 9
#define ARC_DIRECTION 10
#define CURVE_TYPE 11
#define TEXT_FONTNAME 12
#define TEXT_WIDTH 13
#define TEXT_HEIGHT 14
#define TEXT_ANGLE 15
#define TEXT_SLANT 16
#define TEXT_CHARSPACE 17
#define TEXT_LINESPACE 18
#define TEXT_NAME 19
#define NODE_BOUNDS 20
#define EDGE_TYPE 21
#define PROP_FILL 22
#define FILL_AMOUNT 23
#define TEXT_UNDERLINE 24
#define TEXT_WEIGHT 25
#define TEXT_PTSIZE 26
#define V_DYN_ROTATE 30
#define V_DYN_PATH_MOVE 31
#define V_DYN_REL_MOVE_X 32
#define V_DYN_REL_MOVE_Y 33
#define V_DYN_ABS_MOVE_X 34
#define V_DYN_ABS_MOVE_Y 35
#define V_DYN_SCALE 36
#define V_DYN_SCALE_X 37
#define V_DYN_SCALE_Y 38
#define V_DYN_SUBDRAWING 39
#define V_DYN_FILL_RIGHT 40
#define V_DYN_FILL_UP 41
#define V_DYN_FILL_LEFT 42
#define V_DYN_FILL_DOWN 43
#define V_DYN_TEXT 44
#define V_DYN_VISIBILITY 45
/* Useful visibility and pickability masks */
#define V_DYN_ALWAYS_MASK 0xffffffff
/* ================================================== *\
* erase technique defines for dynamic object updates *
\* ================================================== */
#define V_DYN_ERASE_REDRAW_DELAY 1
#define V_DYN_ERASE_RASTER 2
#define V_DYN_ERASE_OBJECT 3
#define V_DYN_ERASE_XOR 4
#define V_DYN_ERASE_NONE 5
#define V_DYN_ERASE_REDRAW_IMMEDIATE 6
#define V_DYN_ERASE_BOX 7
#define V_DYN_ERASE_BGCLR V_DYN_ERASE_OBJECT
#define V_DYN_ERASE_REDRAW V_DYN_ERASE_REDRAW_DELAY
/* ================================================== *\
* dynamic_flag values for subdrawings *
\* ================================================== */
#define SD_DYN_NONE 0
#define SD_DYN_DISABLED 1
#define SD_DYN_ENABLED 2
#define SD_DYN_RESET 3
/* Max number of embedded subdrawing levels */
#define V_MAX_SD_LEVELS 100
/*==========================================*/
/* typedef's for traversal functions */
typedef DV_BOOL (*VODYPARENTTRVRSFUNPTR) V_P_((OBJECT subobj,
ADDRESS testargs));
typedef DV_BOOL (*VOSDTOPTRVRSFUNPTR) V_P_((OBJECT subobj, ADDRESS testargs));
/*==========================================*/
/* Useful system-wide parameter definitions */
/* Return codes for certain classes of routines */
#ifdef DV_SUCCESS
#undef DV_SUCCESS
#endif
#ifdef DV_FAILURE
#undef DV_FAILURE
#endif
#define DV_SUCCESS 1
#define DV_FAILURE 0
/* Maximum and minimum absolute coordinates allowed in a DRAWING. */
#define XMAX 16383
#define YMAX 16383
#define XMIN -16384
#define YMIN -16384
/* Maximum and minimum values that will fit in a DV_COORD type */
#define MAXCOORD 32767
#define MINCOORD -32768
/*====================================================================
|
| FLAGS used in calling VO routines. These FLAG values are defined
| here for use by those who call those routines.
*/
/* Special flag to Get/Set type functions, which flag means */
/* that the value should NOT be set. That is, the current */
/* value should be returned, without changing it. */
/* This is a number that is invalid for all the functions */
/* for which it is used. */
#define DONT_SET_THE_VALUE ((OBJECT)-2)
/* special flag to terminate variable length parameter lists */
#define VI_ARG_END -1
/*====================================================================
|
| Traversal typedef VOxxTraverse
*/
typedef ADDRESS (*TOBFOREACHSUBOBJFUNPTR) V_P_((OBJECT subobj,
ADDRESS argblock));
typedef ADDRESS (*TOBFOREACHVDPFUNPTR) V_P_((OBJECT subobj,
VARDESC vdp,
ADDRESS argblock));
typedef BOOLPARAM (*VOOBTRAVERSEFUNPTR)V_P_((OBJECT subobj,
ADDRESS testargs));
typedef void (*VOGATFILLFUNPTR)V_P_((ADDRESS fillargs, RECTANGLE *vp,
RECTANGLE **obsvps));
typedef void (*VOGATEDGEFUNPTR)V_P_((ADDRESS fillargs, RECTANGLE *vp,
RECTANGLE **obsvps));
typedef void (*VOGDRAWFUNPTR) V_P_((ADDRESS drawargs));
typedef OBJECT (*VODQADDFUNPTR) V_P_((OBJECT entity));
typedef void (*VODQDELFUNPTR) V_P_((OBJECT entity));
typedef BOOLPARAM (*VODQEQUALFUNPTR) V_P_((OBJECT entity1, OBJECT entity2));
typedef int (*VODQCOMPAREFUNPTR) V_P_((OBJECT entity1, OBJECT entity2));
typedef ADDRESS (*VODRNAMETRVRSFUNPTR) V_P_((int position, OBJECT object,
char *name));
typedef void (*VOITECHOFUNPTR)V_P_((OBJECT Input, int Origin, int State,
double *Value, VARDESC Vdp,
RECTANGLE *EchoVP, ADDRESS args));
typedef ADDRESS (*VOSMREALLOCFUNPTR)V_P_((char *ptr, unsigned int size));
/* To allow backward compatability.... */
typedef VOOBTRAVERSEFUNPTR VOOBTRAVERSEFUN;
typedef VOGDRAWFUNPTR VOGDRAWFUN;
/*---------------------------------------------------------------------
|
| VO??Statistic - For returning statistics about objects.
*/
#define OBJECT_COUNT ((int)('c'))
/*---------------------------------------------------------------------
|
| VOacCreate, VOacGetLanguage - Language flags.
*/
typedef enum
{
ACTIONLANGUAGE /* action language */
} VI_ACLANGUAGE;
/*---------------------------------------------------------------------
|
| VOcoCreate - Format flags.
*/
#define COLOR_COMPONENTS ((int)('c'))
#define COLOR_INDEX ((int)('i'))
#define COLOR_NAME ((int)('n'))
#define COLOR_REFERENCE ((int)('r'))
#define COLOR_STRUCTURE ((int)('s'))
/*---------------------------------------------------------------------
|
| VOdqAdd - flags.
*/
#define TOP ((int)('t')) /* top of dq */
#define BOTTOM ((int)('b')) /* bottom of dq */
/*---------------------------------------------------------------------
|
| VOdrBackcolor - color.
| A special color that indicates that the drawing has no
| background color, that is, the drawing has a transparent
| background.
*/
#define NO_BACKGROUND -1
#define V_NO_COLOR -1
/*---------------------------------------------------------------------
|
| VOdrOffcolor - color.
| A special color that indicates that the off-drawing is not
| to be drawn.
*/
#define NO_OFF_DRAWING_COLOR -1
/*---------------------------------------------------------------------
|
| VOobEval Type flags
*/
typedef enum
{
V_OB_EVAL_NULL = 0,
V_OB_EVAL_DRAW_STATIC,
V_OB_EVAL_DRAW_DYNAMIC,
V_OB_EVAL_DRAW_FULL,
V_OB_EVAL_DRAW_REPAIR,
V_OB_EVAL_ERASE,
V_OB_EVAL_DISPLAY_ENV_SET,
V_OB_EVAL_DONE,
V_OB_EVAL_DATA_RESET,
V_OB_EVAL_DATA_UPDATE,
V_OB_EVAL_SET_TO_UPDATE,
V_OB_EVAL_DATA_DONE,
V_OB_EVAL_DISPLAY_ENV_DONE,
V_OB_EVAL_DRAW_BG,
V_OB_EVAL_ERASE_BG,
V_OB_EVAL_DRAW_STARTUP,
V_OB_EVAL_ENV_SET_DRAW_FULL,
V_OB_EVAL_UPDATE_DRAW_DYNAMIC,
V_OB_EVAL_DISABLE_INPUT,
V_OB_EVAL_DRAW_DYNAMIC_INVISIBLE
} V_OB_EVAL_TYPE;
/* flag values for VOvpEvalExcept */
#define V_EXCEPT_ABOVE 1
#define V_EXCEPT_BELOW -1
#define V_EXCEPT_ALL 0
/*---------------------------------------------------------------------
|
| VOic - flags
*/
/* flags for create/get/set */
typedef enum
{
V_IC_ATTR_ARGEND = 0,
V_IC_HEIGHT, /* height in screen coordinates */
V_IC_WIDTH, /* width in screen coordinates */
V_IC_PIXMAP, /* icon is based on this pixmap */
V_IC_PIXMAP_XFORM, /* how to transform pixmap colors to device's */
V_IC_MASK_PIXMAP, /* pixmap used for icon mask */
V_IC_MASK_PIXMAP_XFORM, /* transform mask colors to draw/no draw */
V_IC_RASTER /* actual raster used to draw icon */
} V_IC_ATTR_ENUM;
/*---------------------------------------------------------------------
|
| VOim - flags
*/
/* flags for create/get/set */
typedef enum
{
V_IM_ATTR_ARGEND = 0,
V_IM_PIXMAP, /* image is based on this pixmap */
V_IM_PIXMAP_XFORM, /* how to transform pixmap colors to device's */
V_IM_MASK_PIXMAP, /* pixmap used for image mask */
V_IM_MASK_PIXMAP_XFORM, /* transform mask colors to draw/no draw */
V_IM_RASTER /* actual raster used to draw image */
} V_IM_ATTR_ENUM;
/*---------------------------------------------------------------------
|
| VOit - flags.
*/
#define TEXT_LIST 't' /* it pickable item list of text strings */
#define OBJECT_LIST 'o' /* it pickable item list of objects */
#define NO_LIST (int)NULL /* it no pickable item list */
/*---------------------------------------------------------------------
|
| VOpm - flags
*/
/* flags for create/get/set */
typedef enum
{
V_PM_ATTR_ARGEND = 0,
V_PM_HEIGHT, /* height of pixmap in pixels */
V_PM_WIDTH, /* width of pixmap in pixels */
V_PM_DEPTH, /* color depth */
V_PM_COLOR_TABLE, /* colors used by pixmap */
V_PM_INCLUDE_PIXELS, /* pixmap type is include or reference */
V_PM_FILENAME, /* name of external file for ref. pixmaps */
V_PM_RAW_DATA, /* data (and length) for include pixmaps */
V_PM_BOUNDS, /* creating raster: part of pix to use */
V_PM_COLOR_XFORM, /* creating raster: color indices xform */
V_PM_VERSION, /* # of changes since creation */
V_PM_PIXREP_DATA /* pixrep representation of pixmap */
} V_PM_ATTR_ENUM;
/* Flags for pixmap graphic conversions. */
typedef enum
{
V_PM_GIF, /* Graphics Interchange Format (c)Compuserve */
V_PM_PPM, /* Portable Pixmap */
V_PM_RASTER, /* VI raster data */
V_PM_TIFF, /* Tag Interchange File Format */
V_PM_BMP, /* Microsoft .bmp format */
V_PM_PIXREP /* VI internal device independent */
} V_PM_FORMAT_ENUM;
/* Flags for pixmap flipping */
typedef enum
{
V_PM_HORIZONTAL = 0, /* Flip over horizontal axis */
V_PM_VERTICAL = 1 /* Flip over vertical axis */
} V_PM_FLIP_ENUM;
/* Ways of merging two pixmaps together. These flags determine how the color
| index of a pixel in the target pixmap is affected by the color index of
| the corresponding pixel in the source pixmap.
*/
typedef enum
{
V_PM_COPY, /* source color index replaces target index */
V_PM_AND, /* new target = source index AND old target */
V_PM_OR, /* new target = source index OR old target */
V_PM_XOR /* new target = source index XOR old target */
} V_PM_MERGEMODE_ENUM;
/*---------------------------------------------------------------------
|
| VOptCreate - Format flags.
*/
#define PIXEL_COORDINATES ((int)('p')) /* screen coordinate pt */
#define SCREEN_COORDINATES ((int)('p')) /* screen coordinate pt */
#define WORLD_COORDINATES ((int)('w')) /* world coordinate pt */
/*---------------------------------------------------------------------
|
| VOptMove - Format flags.
*/
#define DV_ABSOLUTE 'A' /* move absolute pt by absolute amount */
#define DV_RELATIVE 'a' /* move absolute pt by relative amount */
#define ADJUST_OFFSET_WORLD 'r' /* adjust relative pt in world coords */
#define ADJUST_OFFSET_SCREEN 'p' /* adjust relative pt in screen coords */
/*---------------------------------------------------------------------
|
| VOsk reserved keynames and their sizes
*/
#define V_NAMESLOT "V_nameslot"
#define V_NAMESLOTSIZE 1
/*---------------------------------------------------------------------
|
| VOsk type and method flags
*/
#define VOSK_OBJECT_TYPE ((int)'o')
#define VOSK_DYN_OBJECT_TYPE ((int)'d')
#define VOSK_INT_TYPE ((int)'i')
#define VOSK_INT_ARRAY_TYPE ((int)'I')
#define VOSK_SHORT_TYPE ((int)'s')
#define VOSK_STRING_TYPE ((int)'t')
#define VOSK_FLOAT_TYPE ((int)'f')
#define VOSK_FLOAT_ARRAY_TYPE ((int)'F')
#define VOSK_EXTERNAL_TYPE ((int)'x')
#define VOSK_ASSIGN_METHOD ((int)'a')
#define VOSK_CLONE_METHOD ((int)'c')
#define VOSK_DEASSIGN_METHOD ((int)'d')
#define VOSK_SAVE_METHOD ((int)'s')
#define VOSK_RETRIEVE_METHOD ((int)'r')
/*---------------------------------------------------------------------
|
| VOsmFOpen, VOsmFCreate - Access mode flags.
*/
#define WRITE_COMPACT ((int)('w'))
#define WRITE_EXPANDED ((int)('W'))
#define READ_MODE ((int)('r'))
/*---------------------------------------------------------------------
|
| VOuObMove - Move mode flags.
*/
#define ABSOLUTE_MOVE 'a' /* move absolute pt by absolute amount */
#define RELATIVE_MOVE 'r' /* move absolute pt by relative amount */
/*---------------------------------------------------------------------
|
| VOvpGridSet, VOvpGridGet - Get and set grid attributes
*/
/* To turn on snapping to grid */
#define V_VOVP_SNAP_TO_GRID ((int)'s') /* int flag */
/* To turn on display of grid */
#define V_VOVP_DRAW_GRID ((int)'d') /* int flag */
/* To define the type of grid (adaptive or fixed */
#define V_VOVP_ADAPTIVE_GRID ((int)'a') /* int flag */
/* To set number of coordinates between grid marks */
#define V_VOVP_GRID_SPACING ((int)'g') /* int value */
/* Color object to use in drawing grid */
#define V_VOVP_GRID_COLOR ((int)'c') /* OBJECT (LONG) color */
/* To set spacing of grid tick marks */
#define V_VOVP_MINOR_TICK_SPACING ((int)'1') /* int value */
#define V_VOVP_MIDDLE_TICK_SPACING ((int)'2') /* int value */
#define V_VOVP_MAJOR_TICK_SPACING ((int)'3') /* int value */
/*---------------------------------------------------------------------
|
| VOvpXfGet - Transform type flags
*/
/* To get transformation from drawing coordinates to viewport coords */
#define DR_TO_VP 1
/* To get transformation from viewport coordinates to screen coords */
#define VP_TO_SCREEN 2
/* To get transformation from drawing coordinates to screen coords */
#define DR_TO_SCREEN 3
/* To get transformation from screen coordinates to drawing coords */
/* (The inverse of the above transform) */
#define SCREEN_TO_DR 4
/*---------------------------------------------------------------------
|
| VOvd - type flags
*/
#define COLOR 'c' /* color type variable descriptor */
#define NUMBER 'n' /* number type variable descriptor */
#define DV_TEXT 't' /* text type variable descriptor */
/*====================================================================
|
| OBJECT type codes
| Codes defining the objects and their type codes
| NOTE: type codes should be in the range [1,127]
*/
#define LOWEST_TYPE_CODE 1
#define HIGHEST_TYPE_CODE 42
#define OT_ACTION 35 /* VOac* routines */
#define OT_ARC 1 /* VOar* routines */
#define OT_CONTROLLER_DEF 40 /* VOcd* routines */
#define OT_CONTROLLER 41 /* VOcr* routines */
#define OT_CIRCLE 3 /* VOci* routines */
#define OT_COLOR 4 /* VOco* routines */
#define OT_DATASOURCE 6 /* VOds* routines */
#define OT_DEQUE 7 /* VOdq* routines */
#define OT_DG 8 /* VOdg* routines */
#define OT_DRAWING 9 /* VOdr* routines */
#define OT_DYNAMIC 37 /* VOdy* routines */
#define OT_EDGE 30 /* VOedge* routines */
#define OT_ELLIPSE 32 /* VOel* routines */
#define OT_EVENT 39 /* VOev* routines */
#define OT_HEAP 10 /* VOhp* routines */
#define OT_ICON 13 /* VOic* routines */
#define OT_IMAGE 5 /* VOim* routines */
#define OT_INPUT 27 /* VOin* routines */
#define OT_INPUT_TECHNIQUE 28 /* VOit* routines */
#define OT_LINE 11 /* VOln* routines */
#define OT_LOCATION 12 /* VOlo* routines */
#define OT_NODE 31 /* VOnode* routines */
#define OT_PARAMETER 14 /* VOpa* routines */
#define OT_PIXMAP 2 /* VOpm* routines */
#define OT_POINT 15 /* VOpt* routines */
#define OT_POLYGON 16 /* VOpy* routines */
#define OT_RECTANGLE 17 /* VOre* routines */
#define OT_REFCOLOR 38 /* VOco* routines */
#define OT_RULE 36 /* VOru* routines */
#define OT_RGB 18 /* VOco* routines */
#define OT_SCREEN 19 /* VOsc* routines */
#define OT_SLOTKEY 33 /* VOsk* routines */
#define OT_SLOTTABLE 34 /* VOst* routines */
#define OT_STREAM 20 /* VOsm* routines */
#define OT_SUBDRAWING 21 /* VOsd* routines */
#define OT_TEXT 22 /* VOtx* routines */
#define OT_THRESHTABLE 23 /* VOtt* routines */
#define OT_VD 24 /* VOvd* routines */
#define OT_VIEWPORT 25 /* VOvp* routines */
#define OT_VTEXT 29 /* VOvt* routines */
#define OT_XFORM 26 /* VOxf* routines */
#define OT_SFTEXT 42 /* VOsf* routines */
/* Drawing information for the interaction handler */
/* or display formatter */
typedef struct DRAW_INFO
{
LONG ForeColor, BackColor; /* Color indices of foreground
| and background colors for the input object. If these values
| are V_UNDEFINED it means that the interaction handler
| should get the colors from the layout. */
RECTANGLE
WorldVP, /* World coordinates VP for the interaction handler */
ScreenVP, /* Screen coordinates VP for the interaction handler */
ClipVP, /* Clipping viewport stored at the time of the VOinDraw */
**obsvps, /* Null-Terminated list of obscuring viewports */
VPused; /* Actual screen viewport (drawn part of the input)
| used by the interaction handler.
| This is initially set by VOinDraw and MAY BE ADJASTED
| BY AN INTERACTION HANDLER (VNmenu does it). */
OBJECT xform; /* Transform used in drawing the object */
ADDRESS SavedRaster; /* Address of the saved raster area */
OBJECT viewport; /* Object's viewport */
} DRAW_INFO;
typedef struct DRAW_ENV
{
OBJECT xform; /* Transformation to use when draw:
usually is the same as viewport's one */
RECTANGLE *clipvp; /* Clipping rect.: may be smaller or bigger than
viewport boundaries */
RECTANGLE *termvp; /* Special field to be terminate the list when
clipvp field is used as obsvps: we need a
terminating NULL. */
RECTANGLE **obsvps; /* List of obscuring vps */
OBJECT viewport; /* Viewport to draw the object in */
struct
{
unsigned int
inside_sd:1, /* Currently evaluating inside a subdrawing */
pre_80_clr_dyn:1, /* Config flag set to eval pre-8.0 clr dyns */
update_invis_graphs:1, /* Config flag set to update invis graphs */
dy_enabled:1; /* No disabled subdrawings above */
} flags;
} DRAW_ENV;
typedef void (*VODROBDRAWFUNPTR) V_P_((OBJECT object, DRAW_ENV *de));
typedef void (*VODROBERASEFUNPTR) V_P_((OBJECT object, DRAW_ENV *de));
/*===================================================================
|
| ASSIGN_OBJECT
| Assigns object B to location A, making sure that the objects
| are referenced and dereferenced properly. Note that the
| dereference occurs AFTER the reference, to disallow
| destroying the object when assigning it to a location
| that already has the object in it. Note also that the macro
| is written so that B appears only once, in case it is
| a function call. This macro is useful for anytime that
| an object is to assigned to a location (e.g. field in a
| structure) that may already have an object in it.
| Because VOobReference accepts a NULL object without complaint,
| this macro also works to clear a location when you are done.
*/
#define ASSIGN_OBJECT( A, B ) \
{ \
OBJECT temp; \
\
temp = A; \
A = VOobReference( B ); \
if( temp ) VOobDereference( temp ); \
}
/* ==================================================================
The defines below are for pre-9.0 compatibility. If compiling a
file with pre-9.0 defines, set "V_8TO9_COMPATIBILITY" before
including this file */
#ifdef V_8TO9_COMPATIBILITY
#define DYN_ROTATE V_DYN_ROTATE
#define DYN_PATH_MOVE V_DYN_PATH_MOVE
#define DYN_REL_MOVE_X V_DYN_REL_MOVE_X
#define DYN_REL_MOVE_Y V_DYN_REL_MOVE_Y
#define DYN_ABS_MOVE_X V_DYN_ABS_MOVE_X
#define DYN_ABS_MOVE_Y V_DYN_ABS_MOVE_Y
#define DYN_SCALE V_DYN_SCALE
#define DYN_SCALE_X V_DYN_SCALE_X
#define DYN_SCALE_Y V_DYN_SCALE_Y
#define DYN_SUBDRAWING V_DYN_SUBDRAWING
#define DYN_FILL_RIGHT V_DYN_FILL_RIGHT
#define DYN_FILL_UP V_DYN_FILL_UP
#define DYN_FILL_LEFT V_DYN_FILL_LEFT
#define DYN_FILL_DOWN V_DYN_FILL_DOWN
#define DYN_ERASE_REDRAW V_DYN_ERASE_REDRAW
#define DYN_ERASE_RASTER V_DYN_ERASE_RASTER
#define DYN_ERASE_BGCLR V_DYN_ERASE_BGCLR
#define DYN_ERASE_XOR V_DYN_ERASE_XOR
#define DYN_ERASE_NONE V_DYN_ERASE_NONE
#endif /* V_8TO9_COMPATIBILITY */
/* Backward compatibility of upgraded typedefs and defines */
#ifdef DV_OLD_NAMES
#define TRANSPARENT DV_TRANSPARENT
#define ABSOLUTE DV_ABSOLUTE
#define RELATIVE DV_RELATIVE
#define SUCCESS DV_SUCCESS
#define FAILURE DV_FAILURE
#define TEXT DV_TEXT
#endif /* DV_OLD_NAMES */
#endif /* VOSTD_H */